package com.qishon.pc.domain.repository.impl;

import com.qishon.pc.domain.model.MasPartHd;
import com.qishon.pc.domain.repository.PreViewRepository;
import com.qishon.pc.domain.util.PreViewUtils;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * Created by kenwstar on 2017/1/7.
 */
@Mapper
@CacheConfig(cacheNames = "masPart")
@Component
public class PreViewRepositoryImpl implements PreViewRepository{
    @Value("${run.path}")
    private String runPath1;
    @Override
    public MasPartHd findMasPartByPartCode(Map<String, Object> params) {
        PreViewUtils preViewUtils = new PreViewUtils();
        return preViewUtils.getMasPartHd(runPath1+"\\"+"06.Upload\\" + params.get("partCode").toString(),params.get("imageType").toString());
    }
}
